{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Dynamic Process: Robustness to the Share of Updating Voters (C.2)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2021-02-09T13:45:42.597524Z", "start_time": "2021-02-09T13:45:36.046941Z" } }, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "from matplotlib import pyplot as plt\n", "from poisson_approval import *" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2021-02-09T13:45:42.609297Z", "start_time": "2021-02-09T13:45:42.603312Z" } }, "outputs": [], "source": [ "N_SAMPLES = 10000\n", "N_MAX_EPISODES = 1000" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2021-02-09T13:45:42.642208Z", "start_time": "2021-02-09T13:45:42.614283Z" } }, "outputs": [], "source": [ "update_ratios = {\n", " '1': 1,\n", " '0.5': 0.5,\n", " 'one_over_log_log_t_plus_fourteen': one_over_log_log_t_plus_fourteen,\n", " 'one_over_log_t_plus_one': one_over_log_t_plus_one,\n", " 'one_over_sqrt_t': one_over_sqrt_t,\n", " 'one_over_t': one_over_t, \n", "}" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2021-02-09T13:45:42.724481Z", "start_time": "2021-02-09T13:45:42.647194Z" } }, "outputs": [], "source": [ "update_ratios_legend = {\n", " '1': '1', \n", " '0.5': '0.5',\n", " 'one_over_log_log_t_plus_fourteen': '1 / log(log(t + 14))',\n", " 'one_over_log_t_plus_one': '1 / log(t + 1)',\n", " 'one_over_sqrt_t': '1 / sqrt(t)',\n", " 'one_over_t': '1 / t', \n", "}" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2021-02-09T13:45:42.738719Z", "start_time": "2021-02-09T13:45:42.728675Z" } }, "outputs": [], "source": [ "rand_profile = RandProfileHistogramUniform(n_bins=1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Convergence Rate" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2021-02-09T13:45:47.508841Z", "start_time": "2021-02-09T13:45:42.743002Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", " | Approval | \n", "Plurality | \n", "Anti-plurality | \n", "
---|---|---|---|
Share of updating voters | \n", "\n", " | \n", " | \n", " |
1 | \n", "0.9390 | \n", "1.0 | \n", "0.0 | \n", "
0.5 | \n", "0.9461 | \n", "1.0 | \n", "0.0 | \n", "
one_over_log_log_t_plus_fourteen | \n", "0.9492 | \n", "1.0 | \n", "0.0 | \n", "
one_over_log_t_plus_one | \n", "0.9472 | \n", "1.0 | \n", "0.0 | \n", "
one_over_sqrt_t | \n", "0.9503 | \n", "1.0 | \n", "0.0 | \n", "
one_over_t | \n", "0.0558 | \n", "1.0 | \n", "0.0 | \n", "